load("//bzl:cpp_library.bzl", "cpp_library")

package(default_visibility = ["//visibility:public"])

cpp_library(
    name = "atomic_read_mostly_main_ptr",
    srcs = [
        "AtomicReadMostlyMainPtr.cpp",
    ],
    hdrs = [
        "AtomicReadMostlyMainPtr.h",
    ],
    deps = [
        "//folly:indestructible",
        "//folly/concurrency/memory:read_mostly_shared_ptr",
        "//folly/executors:inline_executor",
        "//folly/synchronization:rcu",
    ],
)

cpp_library(
    name = "read_mostly_shared_ptr",
    hdrs = ["ReadMostlySharedPtr.h"],
    deps = [
        "//folly:function",
        "//folly/concurrency/memory:tl_ref_count",
    ],
)

cpp_library(
    name = "primary_ptr",
    hdrs = ["PrimaryPtr.h"],
    deps = [
        "//folly:function",
        "//folly/futures:cleanup",
        "//folly/futures:core",
        "@glog",
    ],
)

cpp_library(
    name = "tl_ref_count",
    hdrs = ["TLRefCount.h"],
    deps = [
        "//folly:thread_local",
        "//folly/synchronization:asymmetric_thread_fence",
        "//folly/synchronization/detail:sleeper",
    ],
)
